#ifndef AH_PROTOCOL_H
#define AH_PROTOCOL_H
/*
 *	AH means Amber Haruhi >/////<
 *	Amber: client
 *	Haruhi: server
 */	
// the client program state
enum AMBER_STATE
{
	AMBER_INIT = 0, // state begin here
	AMBER_INIT_FAILED,
	AMBER_LOGIN,
	AMBER_CREATE_ACCOUNT,
	AMBER_CREATE_ACCOUNT_FAILED,
	AMBER_CREATE_ACCOUNT_SUCCESS,
	AMBER_ACCT_VERIFY,
	AMBER_TERMINATE,
	AMBER_MAINMENU,
	AMBER_CREATE_ROOM,
	AMBER_JOIN_ROOM,
	AMBER_LEAVE_ROOM,
	AMBER_START_GAME,
	AMBER_JOIN_GAME,
	AMBER_LEVEL_GAME,
	AMBER_IN_GAME,
	AMBER_GAME_END,

	AMBER_TOTALSTATE,
};
// the server program state
enum HARUHI_STATE
{
	HARUHI_LISTEN,
	HARUHI_ACCEPT,
	HARUHI_CREATE_THREAD,

	HARIHI_TOTALSTATE,
};
// the COMMAND
// with prefix "AH" means Amber to Haruhi (client to server)
// with prefix "HA" means Haruhi to Amber (server to client)
enum AH_COMMAND
{
	// At begining, the client is in login menu, when in login state, client will send this command to server.
	AH_CONNECT,
	// Then, the server will send this command to client, tell them she is online, offline, etc.
	AH_GET_HARUHI_STATUS,
	HA_SEND_STATUS,
	// When server is online, the client can login to server by press the login button, or create account button.
	AH_LOGIN,
	AH_CREATE_ACCOUNT,

	HA_CREATE_FAILED,
	HA_CREATE_SUCCESS,
	// When server is offline, the login button and create account button will be disabled.
	

};
#if 0
struct _ah_thread
{
	pthread_t thread;
	int run;
	int fd;
};
struct _ah{
	int run;
	int type; // Amber or Haruhi
	void *curr_state; // Current state
	struct _ah_thread send_thread;
	struct _ah_thread recv_thread;
//	just test
	struct _ah_thread read_stdin_thread;
};
#endif
#endif
